<%@page contentType="text/html; charset=UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%String contextPath=request.getContextPath();%>
<script type="text/javascript" src="<%=contextPath%>/js/common/PageCommon.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=contextPath%>/css/mypage.css" />

<div class="paging">
<table><tr>
<td class="btn">
<c:if test="${pageNavi.currentPage-10>=1}">
	<a href="#" onclick="javascript:goMoveList(<c:out value="${pageNavi.pageGroupStart -1}"/>);window.event.returnValue=false"><img src="../images/paging/grid_ft_prevBtn.gif" alt="이전페이지"/></a>
</c:if>
<c:if test="${pageNavi.currentPage-10< 1}">
<img src="<%=contextPath%>/images/common/btn_prev.gif"" alt="이전페이지"/>
</c:if>
</td>

<c:forEach var="idx" begin="${pageNavi.pageGroupStart}" end="${pageNavi.pageGroupEnd}">
	<c:if test="${idx==pageNavi.currentPage}">
		<td><a href="#" class="select"><c:out value="${idx}"/></a></td>
	</c:if>
	<c:if test="${idx!=pageNavi.currentPage}">
		<td><a href="#" onclick="goMoveList(<c:out value="${idx}"/>);window.event.returnValue=false" class="page"><c:out value="${idx}"/></a></td>
	</c:if>
</c:forEach>

<td class="btn">
<c:if test="${pageNavi.pageGroupStart+10<=pageNavi.pageTotal}">
	<a href="#" onclick="javascript:goMoveList(<c:out value="${pageNavi.pageGroupStart+10 }"/>);window.event.returnValue=false"><img src="../images/paging/grid_ft_nextBtn.gif"  alt="다음페이지" /></a>
</c:if>
<c:if test="${pageNavi.pageGroupStart+10>pageNavi.pageTotal}">
	<img src="<%=contextPath%>/images/common/btn_next.gif"  alt="다음페이지" />
</c:if>
</td>
</tr></table>
</div>

<!--<form name="pageNaviForm" method="post" style="display:none">-->
  	<input type="hidden" name="currentPage" value="<c:out value="${pageNavi.currentPage}"/>" >
  	<input type="hidden" name="rowsPerPage" value="<c:out value="${pageNavi.rowsPerPage}"/>">
<!--</form>--> 
<script>
	if(pagingProperty && pagingProperty.searchForm && pagingProperty.searchForm.elements) {

  for(var i = 0; i < pagingProperty.searchForm.elements.length; i++) {
   var inputTag = document.createElement("INPUT");
   inputTag.type = "hidden";
   if(pagingProperty.searchForm.elements[i].type == "radio"){
    if(pagingProperty.searchForm.elements[i].checked == true){
     inputTag.name = pagingProperty.searchForm.elements[i].name;
     inputTag.value = pagingProperty.searchForm.elements[i].value;
     document.pageNaviForm.appendChild(inputTag);    
    }
   }else if(pagingProperty.searchForm.elements[i].type == "checkbox"){
    if(pagingProperty.searchForm.elements[i].checked == true){
     inputTag.name = pagingProperty.searchForm.elements[i].name;
     inputTag.value = pagingProperty.searchForm.elements[i].value;
     document.pageNaviForm.appendChild(inputTag);    
    }    
   }else{
    inputTag.name = pagingProperty.searchForm.elements[i].name;
    inputTag.value = pagingProperty.searchForm.elements[i].value;
    document.pageNaviForm.appendChild(inputTag);
   }
  } 
 }
</script>	
